The present invention relates to a method for coding a sequence of video pictures, comprising at least an analysis step, including a first converting sub-step for converting the current picture into a sequence of macroblocks followed by a first pass encoding sub-step, and a final coding step, including a similar second converting sub-step followed by a second pass encoding sub-step at the end of which an output coded video bitstream is generated which may be used, for instance, for coding a sequence of pictures according to an image coding standard such as MPEG-2. The invention also relates to a video coder for implementing said coding method.
The goal of MPEG is to define a standard for digital compression of video (and audio) signals. The basic principles of this standard are described in the document xe2x80x9cMPEG video coding: a tutorial introductionxe2x80x9d, by S. R. Ely, BBC Research and Development Report, BBC-RD-1996/3. A first generation of video encoders used single-pass encoding. Nowadays, some encoders use at least dual-pass encoding. According to such an encoding mode, each picture is coded twice: a first pass, at the end of which no video stream is generated, allows to collect statistical results and to code with a better quality the same current picture during a second pass, at the end of which the output coded video stream is generated. A greater number of passes may be provided, as observed for instance in the video coder described in the document EP 0940042 (PHF98524), in which, according to FIG. 1, one or several analysis passes AP allow to adjust some coding parameters before implementing, after a prediction step PS, a final coding pass CP.
It is known that the MPEG-2 standard allows to code interlaced pictures, i.e. pictures composed of two interlaced fields. As described in the document EP 0603947 (PHF92570), said pictures can be encoded at the macroblock level according either to a frame encoding mode or to a field encoding one, on the basis of a predefined criterion. However, none of these two solutions is optimal: impairment of the displayed image quality and of the compression efficiency is observed when a picture sequence comprising a lot of motion is frame encoded or, on the contrary, when a quasi motionless sequence is field encoded.
It is therefore an object of the invention to propose an improved coding method with which the cited drawback is avoided.
To this end, the invention relates to a method such as defined in the introductive paragraph of the description and which is moreover characterized in that statistical results are derived from said first pass encoding sub-step, coding decisions being then provided to the second pass encoding sub-step according to predetermined criteria related to said statistical results and to the type of the current picture.
According to the proposed solution, the suitable statistics resulting from the first pass are now used to encode the current picture either in the frame mode if the sequence can be considered as quasi motionless or in the field mode, at the picture level, if a significant motion has been detected with respect to the previous picture (to encode in the field mode means that the picture is de-interlaced and that the two fields constituting this picture are encoded separately and sequentially). The interest of this feature is the following: when an I or a P picture is field encoded (the intra pictures -or I pictures- are coded without any reference to other pictures, the predictive pictures- or P pictures- are coded using motion-compensated prediction from a previous I or P picture), the compression efficiency is also enhanced: the second field can be predicted with reference to the first one, which leads to have less intra blocks to encode I pictures, and to observe a better coherence between the two fields in case of P pictures.
An other object of the invention is to propose a video coder for implementing said coding method.
To this end, the invention relates to a video coder for encoding digital signals corresponding to interlaced-field picture sequences in which each picture is divided into subpictures called macroblocks, comprising a first coding sub-system for carrying out a first coding step at the macroblock level and a second coding sub-system for carrying out a second coding step at the end of which an output coded bitstream is generated, characterized in that:
(A) said first sub-system comprises a first encoding channel, which channel comprises a series arrangement of a first section for compressing interlaced data and an encoding section, and, in parallel therewith, a second encoding channel, which channel comprises a series arrangement of a second section for compressing non-interlaced data and an encoding section, a first prediction channel on the basis of output signals of said first section and, in parallel therewith, a second prediction channel on the basis of output signals of said second section, said second section including at its input side a circuit for de-interlacing the fields and said second prediction channel including a circuit for re-interlacing the fields, a decision sub-assembly comprising means for comparing the output signals of the first and second encoding channels and means for counting the number of macroblocks coded in accordance with the field mode, a computation circuit for counting the number of macroblocks that have been predicted according to the field motion compensated mode, and a processor for receiving said macroblock numbers and storing also the average quantization steps of the current and last picture;
(B) said second sub-system comprises a third encoding channel, which channel comprises a series arrangement of a third section for compressing interlaced data and an encoding section, and, in parallel therewith, a fourth encoding channel, which channel comprises a series arrangement of a fourth section for compressing non-interlaced data and an encoding section, a third prediction channel on the basis of output signals of said first section and, in parallel therewith, a fourth prediction channel on the basis of output signals of said fourth section, said fourth section including at its input side a circuit for de-interlacing the fields and said fourth prediction channel including a circuit for re-interlacing the fields, a decision sub-assembly comprising means for comparing the output signals of the first and second encoding channels and means for selecting the prediction and encoding channels in accordance with the result of said comparison, and a selection stage comprising means for connecting the pictures to be coded to the input of said second sub-system either directly or via a circuit for suppressing the field interlacing, according to the value of an output flag delivered by the processor on the basis of statistical results constituted by its input signals.